/**************************************************************************************************
* Title: SmurfsPhysicsManager.h
* Authors: Gael Huber, Erin Mooney
* Description: Manages updating of physics
**************************************************************************************************/
#ifndef __PHYSICSMANAGER_H__
#define __PHYSICSMANAGER_H__

#include <vector>
#include "SmurfsRigidBody.h"
#include "SmurfsSingleton.h"
#include "SmurfsQuaternion.h"
#include "SmurfsTimer.h"
#include "Spring.h"

#define GRAVITY -9.8f

class PhysicsManager : public Singleton<PhysicsManager> {
public:
	PhysicsManager(void);	// Constructor
	virtual ~PhysicsManager(void);	// Destructor

	void startUp(void);		// Initialize OpenGL
	void shutDown(void);	// Shutdown

	static PhysicsManager& getSingleton(void);	// Get the singleton instance
	static PhysicsManager* getSingletonPtr(void);	// Get the singleton pointer

	void update(void);	// Render the scene

	// Getters and setters
	RigidBody* getBar(void);
	void setBar(RigidBody* value);
	Spring* getSpring(void);
	void setSpring(Spring* value);
	Vector3 getPivot(void);
	void setPivot(Vector3 value);

private:
	RigidBody* bar;		// The bar which bounces around
	Spring* spring;		// The spring which causes bouncing and holds the bar
	Vector3 pivot;		// The pivot point of the bar
	Timer* timer;		// Timer used for proper physics calculations
};

#endif